package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.NetworkCard;
import com.bocloud.common.model.Param;
import com.bocloud.common.model.SimpleBean;
import com.bocloud.database.core.intf.GenericDao;

/**
 * 物理网卡DAO接口
 * 
 * @author weiwei
 *
 */
public interface NetworkCardDao extends GenericDao<NetworkCard, Long> {

	public List<SimpleBean> list(List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 查询数量
	 * 
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params) throws Exception;

	/**
	 * 根据云供应商ID删除
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public boolean removeByVid(Long vendorId, Long userId) throws Exception;

	/**
	 * 根据平台Id查询
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public List<NetworkCard> listByVendor(Long vendorId) throws Exception;

	/**
	 * 删除
	 * 
	 * @param id
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public Boolean delete(Long id, Long userId) throws Exception;

	/**
	 * 根据ID查询
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public NetworkCard query(Long id) throws Exception;

	/**
	 * 根据宿主机ID查询
	 * 
	 * @param hostId
	 * @param category
	 * @return
	 * @throws Exception
	 */
	public List<NetworkCard> listByHost(Long hostId, String category) throws Exception;

	/**
	 * 根据虚拟宿主机ID删除
	 * 
	 * @param hostId
	 * @param category
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public boolean deleteByHost(Long hostId, String category, Long userId) throws Exception;
}
